﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;

namespace AuctionHouseDataLibrary
{
    [Serializable]
    [DataContract]
    public class Auction
    {
        [Key]
        [DataMember]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public int AuctionId { get; set; }

        [DataMember]
        public long? BuyoutValue { get; set; }

        [DataMember]
        [ForeignKey("Item")]
        public int ItemId { get; set; }

        [DataMember]
        public Item Item { get; set; }

        [DataMember]
        [MaxLength(50)]
        public string OwnerName { get; set; }

        [DataMember]
        public int Quantity { get; set; }

        // This field is not persisted to the DB or sent across the wire. It is purely for temporary storage
        [IgnoreDataMember]
        [NotMapped]
        public long CurrentBidValue { get; set; }

        [DataMember]
        [MaxLength(50)]
        public string AuctionHouse { get; set; }
    }
}